linux-perf: Remove remaining source filenames from executable
authorBen Hutchings <benh@debian.org>
Mon, 29 May 2023 22:16:39 +0000 (00:16 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 12 Mar 2026 12:28:10 +0000 (13:28 +0100)
When we build perf with -ffile-prefix-map, there are still 2
source directory names embedded in the executable:

1. The Documentation subdirectory, used as a fallback from the
   installed location.
2. The python subdirectory, used in the Python script test.

Remove (1) since it is an unnecessary fallback.  Change (2)
to the installed location.

Gbp-Pq: Topic debian
Gbp-Pq: Name linux-perf-remove-remaining-source-filenames-from-executable.patch

tools/perf/Build
tools/perf/builtin-report.c

index b03cc59dabf81d1132ac16d8a2fe653d4b361f59..f62599cc21af05b0a28558e678f56ddb71a8cc67 100644 (file)
@@ -52,7 +52,7 @@ CFLAGS_perf.o              += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))"     \
                              -DPREFIX="BUILD_STR($(prefix_SQ))"
 CFLAGS_builtin-trace.o    += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))"
 CFLAGS_builtin-report.o           += -DTIPDIR="BUILD_STR($(tipdir_SQ))"
-CFLAGS_builtin-report.o           += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
+#CFLAGS_builtin-report.o          += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
 
 perf-util-y += util/
 perf-util-y += arch/
index add6b1c2aaf04270fc87825a759142d90ef61356..7c50228b6838508adc6b6a5820bfa87475c5ae62 100644 (file)
@@ -670,10 +670,12 @@ static int report__browse_hists(struct report *rep)
 
        path = system_path(TIPDIR);
        if (perf_tip(&help, path) || help == NULL) {
+#if 0
                /* fallback for people who don't install perf ;-) */
                free(path);
                path = system_path(DOCDIR);
                if (perf_tip(&help, path) || help == NULL)
+#endif
                        help = strdup("Cannot load tips.txt file, please install perf!");
        }
        free(path);